package com.itheima.d4_jdk8_time;

import java.time.LocalDate;
import java.time.Period;

public class Test6_Period {
    public static void main(String[] args) {
        // 创建时间段
        LocalDate period1 = LocalDate.of(1, 2, 3);
        LocalDate period2 = LocalDate.of(2, 3, 4);

        Period period = Period.between(period1, period2);

        System.out.println(period.getYears());
        System.out.println(period.getMonths());
        System.out.println(period.getDays());

    }
}
